<%@ Control Language="VB" AutoEventWireup="false" CodeFile="ArticleListing.ascx.vb" Inherits="Controls_ArticleListing" %>

<asp:ObjectDataSource ID="objAllCategories" runat="server" SelectMethod="GetCategories"
    TypeName="MB.Psych.BLL.Articles.Category"></asp:ObjectDataSource>
<asp:Literal runat="server" ID="lblPageSizePicker"><small><b>Articles per page:</b></small></asp:Literal>
<asp:DropDownList ID="ddlArticlesPerPage" runat="server" AutoPostBack="True">
    <asp:ListItem Value="5">5</asp:ListItem>
    <asp:ListItem Value="10" Selected="True">10</asp:ListItem>
    <asp:ListItem Value="25">25</asp:ListItem>
    <asp:ListItem Value="50">50</asp:ListItem>
    <asp:ListItem Value="100">100</asp:ListItem>
</asp:DropDownList>
<p>
</p>
<asp:GridView ID="gvwArticles" runat="server" AllowPaging="True" AutoGenerateColumns="False"
    DataKeyNames="ID" DataSourceID="objArticles" EmptyDataText="<b>There is no article to show for the selected category</b>"
    ShowHeader="False" SkinID="Articles">
    <Columns>
        <asp:TemplateField HeaderText="Article List (including those not yet published)">
            <HeaderStyle HorizontalAlign="Left" />
            <ItemTemplate>
                <div>
                        <div class="articleabstract" style="font-size:small">
                        <b><asp:Literal ID="lblCategory" runat="server" Text='<%# Eval("subject") %>'></asp:Literal></b><br />
                        <asp:Literal ID="lblAbstract" runat="server" Text='<%# Eval("message") %>'></asp:Literal></div>
                        </div>
                    
                    <b>Posted by: </b>
                    <asp:Literal ID="lblAddedBy" runat="server" Text='<%# Eval("madeby") %>'></asp:Literal>,
                    on
                    <asp:Literal ID="lblAddedDate" runat="server" Text='<%# Eval("addeddate") %>'></asp:Literal>
                    

            </ItemTemplate>
        </asp:TemplateField>
    </Columns>
    <EmptyDataTemplate>
        <b>No articles to show</b></EmptyDataTemplate>
</asp:GridView>
<asp:ObjectDataSource ID="objArticles" runat="server" DeleteMethod="DeleteArticle"
    EnablePaging="True" SelectCountMethod="GetArticleCount" SelectMethod="GetArticles"
    TypeName="MB.PsychCal.BLL.Articles.Article">
    <DeleteParameters>
        <asp:Parameter Name="id" Type="Int32" />
    </DeleteParameters>

</asp:ObjectDataSource>
